/**
 * Description:
 * Class Name:PrintStream
 * Date:2022/5/1 18:12
 *
 * @author LTisme
 * @version JAVA17
 */
package 疯狂Java讲义.第15章_输入输出._15_4_输入输出流体系._15_4_1_处理流的用法;

import java.io.FileOutputStream;
import java.io.IOException;
import java.io.PrintStream;

public class PrintStreamTest {
    public static void main(String[] args) {
        try(
                var fos = new FileOutputStream("Chapter_15_test.txt");
                var ps = new PrintStream(fos)){
            // 使用PrintStream执行输出
            ps.println("普通字符串");
            // 直接使用PrintStream输出对象
            ps.println(new PrintStreamTest());
        }
        catch (IOException ioException){
            ioException.printStackTrace();
        }
    }
}
